package com.ruoyi.car.service.parts.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.car.pojo.TbPartSimRecord;
import com.ruoyi.car.mapper.parts.TbPartSimRecordMapper;
import com.ruoyi.car.service.parts.ITbPartSimRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TbPartSimRecordServiceImpl implements ITbPartSimRecordService {
    @Autowired
    private TbPartSimRecordMapper iTbPartSimRecordMapper;
    @Override
    public List<TbPartSimRecord> simRecordList(TbPartSimRecord tbPartSimRecord) {
        /*老的iccid*/
        String oldIccid = tbPartSimRecord.getOldIccid();
        /*更新的iccid*/
        String newIccid = tbPartSimRecord.getNewIccid();
        /*车辆状态 设置为空*/
        String updateType = tbPartSimRecord.getUpdateType();
        QueryWrapper<TbPartSimRecord> tbPartSimRecordQueryWrapper = new QueryWrapper<>();
        tbPartSimRecordQueryWrapper.like(oldIccid != null,"old_iccid",oldIccid);
        tbPartSimRecordQueryWrapper.like(newIccid != null,"new_iccid",newIccid);
        tbPartSimRecordQueryWrapper.like(updateType != null,"update_date",updateType);
        return iTbPartSimRecordMapper.selectList(tbPartSimRecordQueryWrapper);
    }
}
